#include <WProgram.h>
#include "global.h"
#include "VenusGPS.h"

extern HardwareSerial Serial;

uint8_t prevByte, curByte, type;
uint8_t GPSdata[MAX_PKTLEN];
VenusGPS GPS;


void setup(){
	Serial.begin(9600);
	pinMode(13, OUTPUT);
	pinMode(3, OUTPUT);
	pinMode(4, OUTPUT);
	pinMode(5, OUTPUT);
}

void loop(){

	while(Serial.available()>0){
		curByte = Serial.read();
		if(prevByte==START1 && curByte==START2){
			type = GPS.proccess(GPSdata);
		}
		else{
			prevByte=curByte;
		}
	}
}



int main(void)
{
	init();

	setup();

	for (;;)
		loop();

	return 0;
}
